package com.geek.ch06.mapper;

import com.geek.entity.mark.Items;
import com.geek.entity.mark.OrderDetail;
import com.geek.entity.mark.Orders;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface OrderDetailMapper {

    @Select("select * from orderdetail where orders_id = #{oid}")
    @Results({
            // 映射 OrderDetail 本身字段
            @Result(id=true, property = "id", column = "id"),
            @Result(column = "items_id",property = "items", javaType = Items.class,
            one = @One(select = "com.geek.ch06.mapper.ItemsMapper.selectItemsBydid"))
    })
    public OrderDetail selectDetailByOid(Integer oid);
}
